<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
     <!-- <el-form-item label="ID" prop="id">
        <el-input
          v-model="queryParams.id"
          placeholder="请输入ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="资料名称" prop="dataname">
        <el-input
          v-model="queryParams.dataname"
          placeholder="请输入名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="责任人" prop="firstpeople">
        <el-input
          v-model="queryParams.firstpeople"
          placeholder="请输入第一责任人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="存放位置" prop="position">
        <el-input
          v-model="queryParams.position"
          placeholder="请输入存放位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="资料分类" prop="category">
        <el-input
          v-model="queryParams.category"
          placeholder="请输入分类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="二级分类" prop="secondclassify">
        <el-input
          v-model="queryParams.secondclassify"
          placeholder="请输入二级分类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="资料条码" prop="barcode">
        <el-input
          v-model="queryParams.barcode"
          placeholder="请输入条码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建日期" prop="daydate">
<!--        <el-input
          v-model="queryParams.daydate"
          placeholder="请输入日期"
          clearable
          @keyup.enter.native="handleQuery"
        />-->
        <el-date-picker
          v-model="queryParams.daydate"
          type="date"
          placeholder="请输入日期"
          style="width:92%"
          value-format="yyyy-MM-dd"
          @change="getFilterData"
        />
      </el-form-item>

      <!--      <el-form-item label="附件" prop="enclosure">
              <el-input
                v-model="queryParams.enclosure"
                placeholder="请输入附件"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="用户ID" prop="userId">
              <el-input
                v-model="queryParams.userId"
                placeholder="请输入用户ID"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="部门ID" prop="deptId">
              <el-input
                v-model="queryParams.deptId"
                placeholder="请输入部门ID"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="创建者" prop="createBy">
              <el-input
                v-model="queryParams.createBy"
                placeholder="请输入创建者"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="创建时间" prop="createTime">
              <el-date-picker clearable
                v-model="queryParams.createTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择创建时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="更新者" prop="updateBy">
              <el-input
                v-model="queryParams.updateBy"
                placeholder="请输入更新者"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="更新时间" prop="updateTime">
              <el-date-picker clearable
                v-model="queryParams.updateTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择更新时间">
              </el-date-picker>
            </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:datum:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:datum:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:datum:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
          v-hasPermi="['system:datum:import']"
        >导入
        </el-button>
      </el-col>


      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:datum:exprort']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="datumList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" :index="indexMethod" type="index" prop="id" />
<!--      <el-table-column label="序号" align="center" :index="indexMethod" type="index" width="50"/>-->
      <el-table-column label="名称" align="center" prop="dataname" />
      <el-table-column label="责任人" align="center" prop="firstpeople" />
      <el-table-column label="存放位置" align="center" prop="position" />
      <el-table-column label="分类" align="center" prop="category" />
      <el-table-column label="二级分类" align="center" prop="secondclassify" />
      <el-table-column label="条码" align="center" prop="barcode" />
    <!--  <el-table-column label="日期" align="center" prop="daydate" />-->
    <!--  <el-table-column label="状态" align="center" prop="status" />-->
     <!-- <el-table-column label="附件" align="center" prop="enclosure" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="创建者" align="center" prop="createBy" />-->
<!--      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>-->
      <!--<el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>-->
      <el-table-column label="备注" align="center" prop="remark" />
<!--      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"

            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:datum:edit']"
          >修改</el-button>





          <el-button
            size="mini"
            type="text"

            @click="handleDelete(scope.row)"
            v-hasPermi="['system:datum:remove']"
          >删除</el-button>

          <el-button
            size="mini"
            type="text"

            @click="handlelook(scope.row)"

          >详情</el-button>



        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改【请填写功能名称】对话框 -->
<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->

<!--        <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="1200px" append-to-body>
          <el-form label-position="right" ref="form" :model="form"  :rules="rules"  label-width="150px">-->
     <!--   <el-form-item label="ID" prop="id">
          <el-input v-model="form.id" placeholder="请输入ID" />
        </el-form-item>-->
<!--        <el-form-item label="名称" prop="dataname">
          <el-input v-model="form.dataname" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="责任人" prop="firstpeople">
          <el-input v-model="form.firstpeople" placeholder="请输入第一责任人" />
        </el-form-item>
        <el-form-item label="存放位置" prop="position">
          <el-input v-model="form.position" placeholder="请输入存放位置" />
        </el-form-item>
        <el-form-item label="分类" prop="category">
          <el-input v-model="form.category" placeholder="请输入分类" />
        </el-form-item>
        <el-form-item label="二级分类" prop="secondclassify">
          <el-input v-model="form.secondclassify" placeholder="请输入二级分类" />
        </el-form-item>
        <el-form-item label="条码" prop="barcode">
          <el-input v-model="form.barcode" placeholder="请输入条码" />
        </el-form-item>-->
<!--            <el-container>
              <el-header>
                <el-divider content-position="left">
                  <p style="color: #00afff; font-size: 18px;">资料信息</p>
                </el-divider>
              </el-header>
              <el-main>
        <el-table-row>
          <el-col span="12">
            <el-form-item label="名称" prop="dataname">
              <el-input v-model="form.dataname" placeholder="请输入名称" />
            </el-form-item>
          </el-col>
          <el-col span="12">
            <el-form-item label="责任人" prop="firstpeople">
              <el-input v-model="form.firstpeople" placeholder="请输入第一责任人" />
            </el-form-item>
          </el-col>
        </el-table-row>
        <el-table-row>
          <el-col span="12">
            <el-form-item label="存放位置" prop="position">
              <el-input v-model="form.position" placeholder="请输入存放位置" />
            </el-form-item>
          </el-col>
          <el-col span="12">
            <el-form-item label="分类" prop="category">
              <el-input v-model="form.category" placeholder="请输入分类" />
            </el-form-item>
          </el-col>
        </el-table-row>
        <el-table-row>
          <el-col span="12">
            <el-form-item label="二级分类" prop="secondclassify">
              <el-input v-model="form.secondclassify" placeholder="请输入二级分类" />
            </el-form-item>
          </el-col>
          <el-col span="12">
            <el-form-item label="条码" prop="barcode">
              <el-input v-model="form.barcode" placeholder="请输入条码" />
            </el-form-item>
          </el-col>
        </el-table-row>
              </el-main>

              <el-main>
        <el-table-row>
          <el-row>
            <el-col span="24">
              <el-form-item label="附件" prop="enclosure">
                <file-upload   v-model="form.enclosure"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-table-row>
              </el-main>-->





      <!--  <el-form-item label="日期" prop="daydate">
          <el-input v-model="form.daydate" placeholder="请输入日期" />
        </el-form-item>-->
      <!--  <el-form-item label="附件" prop="enclosure">
        <el-upload
                   ref="upload"
                   :limit="1"
                   accept=".jpg, .png,.jpeg,.pdf"
                   :action="upload.url"
                   :headers="upload.headers"
                   :file-list="upload.fileList"
                   :on-progress="handleFileUploadProgress"
                   :on-success="handleFileSuccess"
                   :auto-upload="false">
          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
          <el-button style="margin-left: 10px;" size="small" type="success" :loading="upload.isUploading" @click="submitUpload">上传到服务器</el-button>
          <div slot="tip" class="el-upload__tip">只能上传jpg/png/jpeg/pdf文件，且不超过500kb</div>
                </el-upload>
        </el-form-item>-->
        <!--<el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>-->

<!--            </el-container>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>-->
    <!-- 添加或修改资料信息对话框 -->
    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="900px"  append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">

        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff;font-size: 18px;">资料信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-table-row>
              <el-col span="8">
                <el-form-item label="资料名称" prop="dataname">
                  <el-input v-model="form.dataname" placeholder="请输入名称" />
                </el-form-item>
              </el-col>
              <el-col span="8">
                <el-form-item label="责任人" prop="firstpeople">
                  <el-input v-model="form.firstpeople" placeholder="请输入第一责任人" />
                </el-form-item>
              </el-col>
              <el-col span="8">
                <el-form-item label="存放位置" prop="position">
                  <el-input v-model="form.position" placeholder="请输入存放位置" />
                </el-form-item>
              </el-col>
            </el-table-row>
            <!--            <el-table-row>


                        </el-table-row>-->
            <el-table-row>
              <el-col span="8">
                <el-form-item label="资料分类" prop="category">
                  <el-input v-model="form.category" placeholder="请输入分类" />
                </el-form-item>
              </el-col>
              <el-col span="8">
                <el-form-item label="二级分类" prop="secondclassify">
                  <el-input v-model="form.secondclassify" placeholder="请输入二级分类" />
                </el-form-item>
              </el-col>
              <el-col span="8">
                <el-form-item label="资料条码" prop="barcode">
                  <el-input v-model="form.barcode" placeholder="请输入条码" />
                </el-form-item>
              </el-col>
            </el-table-row>
          </el-main>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff;font-size: 18px;">附件信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-table-row>
              <el-col span="24">
                <el-form-item label="电子附件" prop="enclosure">
                  <file-upload   v-model="form.enclosure"/>
                </el-form-item>
              </el-col>
            </el-table-row>
          </el-main>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff;font-size: 18px;">备注信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-table-row>
              <el-col span="24">
                <el-form-item label="备注信息" prop="remark">
                  <el-input :rows="1" v-model="form.remark" type="textarea" placeholder="请输入内容" />
                </el-form-item>
              </el-col>
            </el-table-row>
          </el-main>
        </el-container>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 用户导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip" slot="tip">
          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
        </div>
        <div class="el-upload__tip" style="color:red" slot="tip">提示：仅允许导入“xls”或“xlsx”格式文件！</div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>




  </div>
</template>

<script>
import { listDatum, getDatum, delDatum, addDatum, updateDatum } from "@/api/group/lck/datum";
import { getToken } from "@/utils/auth";
export default {
  name: "Datum",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 【请填写功能名称】表格数据
      datumList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        id: null,
        dataname: null,
        firstpeople: null,
        position: null,
        category: null,
        secondclassify: null,
        barcode: null,
        daydate: null,
        status: null,
        enclosure: null,
        userId: null,
        deptId: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },

      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {Authorization: "Bearer " + getToken()},
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/system/datum/importData",
        fileList: []
      },


         /*// 上传参数
         upload: {
           // 是否禁用上传
           isUploading: false,
           // 设置上传的请求头部
           headers: { Authorization: "Bearer " + getToken() },
           // 上传的地址
           url: process.env.VUE_APP_BASE_API + "/common/upload",
           // 上传的文件列表
           fileList: []
         },*/
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      },
      searchData: {
          inputValue1: '',
          inputValue2: '',
          date: ''
        }
    };
  },
  mounted() {
    this.getNowTime()
  },

  created() {
    const  datumname = this.$route.query. datumname;
    const firstname = this.$route.query.firstname;
    const  datumlocal = this.$route.query. datumlocal;


    const barcode = this.$route.query.barcode;
    console.log( datumname+" datumname");
    console.log(barcode+"barcode");
    if ( datumname) {
      // 获取表详细信息
      this.queryParams.dataname= datumname;
      this.queryParams.barcode=barcode;
      listDatum(this.queryParams).then(response => {
        this. datumList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    }else if(firstname){
      // 获取表详细信息
      this.queryParams.firstpeople=firstname;
      this.queryParams.barcode=barcode;
      listDatum(this.queryParams).then(response => {
        this. datumList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    }else if( datumlocal){
      // 获取表详细信息
      this.queryParams.position= datumlocal;
      this.queryParams.barcode=barcode;
      listDatum(this.queryParams).then(response => {
        this.datumList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    }else if(barcode){
      // 获取表详细信息

      this.queryParams.barcode=barcode;
      listDatum(this.queryParams).then(response => {
        this.datumList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    }
    else{
      this.getList();
    }
  },
  methods: {

    getFilterData() {
      this.$emit('getFilterData', this.searchData)
    },
    getNowTime() {
      var now = new Date()
      var year = now.getFullYear() // 得到年份
      var month = now.getMonth() // 得到月份
      var date = now.getDate() // 得到日期
      month = month + 1
      month = month.toString().padStart(2, '0')
      date = date.toString().padStart(2, '0')
      var defaultDate = `${year}-${month}-${date}`
      this.$set(this.searchData, 'date', defaultDate)
    },

    //生成表头序号
    indexMethod(index) {
      /*index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize*/
      return index+1;
    },

    /** 查询【请填写功能名称】列表 */
    getList() {
      this.loading = true;
      listDatum(this.queryParams).then(response => {
        this.datumList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        dataname: null,
        firstpeople: null,
        position: null,
        category: null,
        secondclassify: null,
        barcode: null,
        daydate: null,
        status: "0",
        enclosure: null,
        userId: null,
        deptId: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getDatum(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateDatum(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDatum(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
        // 文件提交处理
        submitUpload() {
          this.$refs.upload.submit();
        },
        /*// 文件上传中处理
        handleFileUploadProgress(event, file, fileList) {
          this.upload.isUploading = true;
        },
        // 文件上传成功处理
        handleFileSuccess(response, file, fileList) {
          this.upload.isUploading = false;
          this.form.filePath = response.url;
          this.msgSuccess(response.msg);
        },*/

    /** 详情操作 */
    handlelook(row) {
      const id = row.id;
      // const tableName = row.tableName || this.tableNames[0];
      const params = {pageNum: this.queryParams.pageNum};

      this.$router.push({path: "/basedata/datum_detail", query: {id}});
    },



    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项？').then(function() {
        return delDatum(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download('/system/map/importTemplate', {}, `map_template_${new Date().getTime()}.xlsx`)
    },

    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "导入";
      this.upload.open = true;
    },
// 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
// 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
      this.getList();
    },
// 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },



    /** 导出按钮操作 */
    handleExport() {
      this.download('system/datum/export', {
        ...this.queryParams
      }, `datum_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
